﻿@using WebEntities;
@using WebsiteUI.Extensions;
@using Tools.com.Pager;

@model PagedList<WI_News>

@{
    ViewBag.Title = ViewBag.CataName + "_文章列表_城市垃圾处理网";
    ViewBag.ClassHead = "head_bg2";
}
<div class="listMain">
    <div class="main_l">
        @Html.Action("CircleMenu", "PublicPartialView", new { id = (int)ViewBag.ArgID })
        <div class="contentBox">
            <div class="searchArea">
            @using (Html.BeginForm("searchnews", "list"))
            {
                <div class="tit">
                    查找文章</div>
                @Html.TextBox("search", null, new { maxlength = "20", placeholder = "请输入搜索内容", Class = "txtInp" })
                <select name="stype">
                    <option value="newsTitle">按标题查找</option>
                    <option value="newsDescr">按内容查找</option>
                </select>
                 <input type="submit" value="" class="btnSearch" />
            }
            </div>
        </div>
        <div class="contentBox">
            <div class="con_bar">
                <span class="fl tit">最新产品信息</span>
                <div class="cls">
                </div>
            </div>
            <div class="con_Main">
            @{
                List<PP_Product> ltprodLst = ViewBag.LeftProdList as List<PP_Product>;
                foreach (var prod in ltprodLst)
                {
                    <div class="lastPic">
                        <a href="/detail/product/@prod.ProductID" target="_blank" title="@prod.ProductName">
                            <img src="@(prod.ProductCover ?? "/Resource/images/test4.png")" width="95" height="66" alt="@prod.ProductName" /></a></div>
                }
            }
                <div class="cls"></div>
            </div>
        </div>
         @Html.Action("Contact", "PublicPartialView")
    </div>
    <div class="main_r">
        @Html.Action("PageCurrentPath", "PublicPartialView", new { id = (int)ViewBag.ArgID })
        <div class="contentBox">
            <div class="tab">
                <ul>
                    <li class="current"><a href="/list/view/@ViewBag.CataID">@ViewBag.CataName</a></li>
                </ul>
               <span class="subitem">
               @{
                   List<WI_NewsCata> cataList = ViewBag.NewsCataList as List<WI_NewsCata>;
                   for (int i = 0; i < cataList.Count; i++)
                   {
                        <a href="/list/view/@cataList[i].CataID">@cataList[i].CataName</a>
                       if (i < cataList.Count - 1)
                       {
                            @: | 
                        }
                   }
                }
               </span>
            </div>
            <div class="tab-content">
               @foreach (var news in Model)
               {
                   string mark = (news.Important == 2) ? "red" : "";
                   <dl class="picList-show">
                       <dt><a href="/detail/index/@news.NewsID" target="_blank" title="@news.NewsTitle">
                           <img src="@(news.NewsCover ?? "/Resource/images/test4.png")" width="95" height="70" alt="" /></a></dt>
                       <dd>
                           <div class="tit">
                               <a href="/detail/index/@news.NewsID" target="_blank" title="@news.NewsTitle" class="@mark">@news.NewsTitle</a>
                           </div>
                           @{
                   string htmlDescr = Server.HtmlDecode(news.Description);
                   string plainDescr = HtmlWorkshop.StripHtml(htmlDescr ?? string.Empty);
                           }
                           <p class="gray">@Html.Raw(HtmlWorkshop.CutTitle(plainDescr, 80))</p>
                           <div class="">
                               创建时间：@((news.PubTime ?? news.CreateTime).ToString("yyyy-MM-dd"))  等级:@((news.Important == 2) ? "重要" : "一般")</div>
                       </dd>
                       <div class="cls"></div>
                   </dl>
               }
               @Html.Pager(Model, new PagerOptions
                {
                    PageIndexParameterName = "page",
                    CurrentPagerItemWrapperFormatString = "<a class=\"mvc-paged\">{0}</a>",
                    CssClass = "mvc-pager",
                    HorizontalAlign = "center"
                })
            </div>
        </div>
    </div>
</div>
